package com.lakeworks.service.impl;

import com.lakeworks.common.core.text.Convert;
import com.lakeworks.common.domain.ticket.TktNodeDecisions;
import com.lakeworks.mapper.TktNodeDecisionsMapper;
import com.lakeworks.service.ITktNodeDecisionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 流程节点决策信息Service业务层处理
 *
 * @author lake
 * @date 2023-07-18
 */
@Service
public class TktNodeDecisionsServiceImpl implements ITktNodeDecisionsService {
    @Autowired
    private TktNodeDecisionsMapper tktNodeDecisionsMapper;

    /**
     * 查询流程节点决策信息
     *
     * @param id 流程节点决策信息主键
     * @return 流程节点决策信息
     */
    @Override
    public TktNodeDecisions selectTktNodeDecisionsById(Long id) {
        return tktNodeDecisionsMapper.selectTktNodeDecisionsById(id);
    }

    /**
     * 查询流程节点决策信息列表
     *
     * @param tktNodeDecisions 流程节点决策信息
     * @return 流程节点决策信息
     */
    @Override
    public List<TktNodeDecisions> selectTktNodeDecisionsList(TktNodeDecisions tktNodeDecisions) {
        return tktNodeDecisionsMapper.selectTktNodeDecisionsList(tktNodeDecisions);
    }

    /**
     * 新增流程节点决策信息
     *
     * @param tktNodeDecisions 流程节点决策信息
     * @return 结果
     */
    @Override
    public int insertTktNodeDecisions(TktNodeDecisions tktNodeDecisions) {
        return tktNodeDecisionsMapper.insertTktNodeDecisions(tktNodeDecisions);
    }

    /**
     * 修改流程节点决策信息
     *
     * @param tktNodeDecisions 流程节点决策信息
     * @return 结果
     */
    @Override
    public int updateTktNodeDecisions(TktNodeDecisions tktNodeDecisions) {
        return tktNodeDecisionsMapper.updateTktNodeDecisions(tktNodeDecisions);
    }

    /**
     * 批量删除流程节点决策信息
     *
     * @param ids 需要删除的流程节点决策信息主键
     * @return 结果
     */
    @Override
    public int deleteTktNodeDecisionsByIds(String ids) {
        return tktNodeDecisionsMapper.deleteTktNodeDecisionsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除流程节点决策信息信息
     *
     * @param id 流程节点决策信息主键
     * @return 结果
     */
    @Override
    public int deleteTktNodeDecisionsById(Long id) {
        return tktNodeDecisionsMapper.deleteTktNodeDecisionsById(id);
    }

    @Override
    public List<TktNodeDecisions> selectDecByNodeId(Long nodeId) {
        return tktNodeDecisionsMapper.selectDecByNodeId(nodeId);
    }
}
